<div class="modal-header">
    <h4 class="modal-title">请输入用户名和密码登录</h4>
</div>
<div class="modal-body">
    <form class="form-horizontal" name="loginForm">
        <label class="col-xs-offset-1 col-xs-10 bg-danger m-b" ng-show="failLogin&&!submitted">{{Message}}</label>
        <label class="col-xs-offset-1 col-xs-10 bg-danger m-b"
               ng-show="loginForm.$invalid&&submitted&& !loginForm.password.focused">
            <span ng-show="loginForm.password.$error.required">请输入密码</span>
            <span ng-show="loginForm.validateCode.$error.required&&!loginForm.password.$error.required">请输入验证码</span>
        </label>
        <div class="form-group">
            <label class="col-xs-2 control-label">登录名</label>
            <div class="col-xs-8">
                <input type="text" class="form-control" ng-model="user.loginName" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label">密码</label>
            <div class="col-xs-8">
                <input type="password" name="password" class="form-control" ng-model="user.password" required yb-focus>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label">验证码</label>
            <div class="col-xs-6">
                <input type="text" name="validateCode" class="form-control" ng-model="user.code" required>
            </div>
            <div class="col-xs-2">
                <img ng-src="{{ codeImg| ApiUrl }}" ng-click="refresh()">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-2">
                <button type="submit" class="btn btn-primary m-r-sm" ng-click="login(loginForm.$valid)">登录</button>
                <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
            </div>
        </div>
    </form>
</div>